<div class="span-19">


                <div id="content">
                    <h1>Update Line</h1>


                    <div class="form"> 
                    <?php if (isset($error)): ?>
                        <div class="flash-error">
                            <ul>
                                <?php echo $error; ?>
                            </ul>
                        </div>
                    <?php endif; ?>                       
                        <form enctype="multipart/form-data" id="line-form" action="<?php echo base_url(); ?>line/update/<?php echo $id; ?>" method="post">
                            <p class="note">Fields with <span class="required">*</span> are required.</p>


                            <div class="row">
                                <label for="Line_name" class="required">Name <span class="required">*</span></label>        <input size="50" maxlength="50" name="Line[code]" id="Line_name" type="text" value="<?php echo $code; ?>">            </div>

                            <div class="row">
                                <label for="Line_start_time_operation" class="required">Start Time Operation <span class="required">*</span></label>        

                                <select name="Line[start_time_operation]" id="start_time_operation">
                                <?php 
                                    for ($i=0;$i<24;$i++){
                                        if (substr($start_time_operation,0,2) == $i) {
                                            printf('<option value="%02d:00:00" selected="selected">%02d:00:00</option>', $i, $i);
                                        } else {
                                            printf('<option value="%02d:00:00">%02d:00:00</option>', $i, $i);
                                        }  
                                    }
                                ?>
                                </select>

                            </div>

                            <div class="row">
                                <label for="Line_end_time_operation" class="required">End Time Operation <span class="required">*</span></label>        
                                <select name="Line[end_time_operation]" id="end_time_operation">
                                    <?php 
                                    for ($i=0;$i<24;$i++){
                                        if (substr($end_time_operation,0,2) == $i) {
                                            printf('<option value="%02d:00:00" selected="selected">%02d:00:00</option>', $i, $i);
                                        } else {
                                            printf('<option value="%02d:00:00">%02d:00:00</option>', $i, $i);
                                        }  
                                    }
                                    ?>
                                </select>         
                            </div>

                            <div class="row">
                                <label for="Line_type">Type</label>        <select name="Line[type]" id="Line_type">
                                <?php
                                    $typearr = array('Tram', 'Bus', 'Nightliner', 'Reginalbus');
                                    for ($i=0;$i<=3; $i++) {
                                        if ($typearr[$i] == $type) {
                                            printf('<option value="%s" selected="selected">%s</option>', $typearr[$i], $typearr[$i]);
                                        } else {
                                            printf('<option value="%s">%s</option>', $typearr[$i], $typearr[$i]);
                                        }
                                    }
                                ?>
                                </select>            </div>
                            <div class="row">
                                <label>Map</label>
                                <img class="thumb" src="<?php echo base_url('uploads/lines/'.$map); ?>" />
                            </div>

                            <div class="row">
                                <label for="Line_map" class="required">Map <span class="required">*</span></label> 
                                <input type="hidden" name="oldImg" value="<?php echo $map; ?>" />                      
                                <input name="fUpload" id="Line_map" type="file">            </div>

                                        <div class="row buttons">
                                            <input type="submit" name="yt0" value="Update">    </div>

                                        </form>
                                        </div><!-- form -->	</div><!-- content -->



                                        </div>
                                        <div class="span-5 last">
                                            <div id="sidebar">
                                                <div class="portlet" >
                                                    <div class="portlet-decoration">
                                                        <div class="portlet-title">Operations</div>
                                                    </div>
                                                    <div class="portlet-content">
                                                        <ul class="operations" >
                                                            <li><a href="<?php echo base_url();?>line/display">List Line</a></li>
                                                            <li><a href="<?php echo base_url();?>line/manage">Manage Line</a></li>
                                                        </ul></div>
                                                </div>	</div><!-- sidebar -->
                                        </div>
